//
//  OrderDetailsTableViewCell.m
//  chongwu
//
//  Created by 隼目 on 2021/9/22.
//

#import "OrderDetailsTableViewCell.h"

@implementation OrderDetailsTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

-(void)creatAddressView{
    self.backgroundColor=[UIColor clearColor];
    
    UIView *centerView=[UIView new];
    [self.contentView addSubview:centerView];
    [centerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30*_mainWidth);
        make.right.mas_equalTo(-30*_mainWidth);
        make.top.mas_equalTo(10*_mainHeight);
        make.bottom.mas_equalTo(-10*_mainHeight);
    }];
    centerView.backgroundColor=[UIColor whiteColor];
    centerView.layer.cornerRadius=25*_mainWidth;
    
    UIView *xianView=[UIView new];
    [centerView addSubview:xianView];
    [xianView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(113*_mainWidth);
        make.right.mas_equalTo(-45*_mainWidth);
        make.height.mas_equalTo(1);
        make.centerY.mas_equalTo(0);
    }];
    xianView.backgroundColor=rgba(232,232,232,1);
    
    UIView *topView=[UIView new];
    [centerView addSubview:topView];
    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.mas_equalTo(0);
        make.bottom.mas_equalTo(xianView.mas_top);
    }];
    
    UILabel *mailLabel=[UILabel new];
    [topView addSubview:mailLabel];
    [mailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30*_mainWidth);
        make.centerY.mas_equalTo(0);
        make.width.height.mas_equalTo(63*_mainWidth);
    }];
    mailLabel.textAlignment=NSTextAlignmentCenter;
    mailLabel.backgroundColor=rgba(34,40,54,1);
    mailLabel.layer.masksToBounds=YES;
    mailLabel.layer.cornerRadius=63*_mainWidth/2;
    mailLabel.text=@"寄";
    mailLabel.font=[UIFont fontWithName:@"FZHei-B01" size:autoScaleW(25)];
    mailLabel.textColor=rgba(255,255,255,1);
    
    UILabel *mailAddressLabel=[UILabel new];
    [topView addSubview:mailAddressLabel];
    [mailAddressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(xianView);
        make.right.mas_equalTo(-40*_mainWidth);
        make.bottom.mas_equalTo(mailLabel.mas_centerY).mas_equalTo(-_mainHeight*5);
    }];
    mailAddressLabel.numberOfLines=0;
    mailAddressLabel.font=[UIFont fontWithName:@"PingFang SC" size:autoScaleW(35)];
    mailAddressLabel.text=@"杭州市阳光母婴中心";
    mailAddressLabel.textColor=rgba(47,47,47,1);
    
    UILabel *mailNameLabel=[UILabel new];
    [topView addSubview:mailNameLabel];
    [mailNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(xianView);
        make.right.mas_equalTo(-182*_mainWidth);
        make.top.mas_equalTo(mailLabel.mas_centerY).mas_equalTo(_mainHeight*5);
    }];
    mailNameLabel.numberOfLines=0;
    mailNameLabel.font=[UIFont fontWithName:@"PingFang SC" size:autoScaleW(35)];
    mailNameLabel.text=@"金有才\t13605443326";
    mailNameLabel.textColor=rgba(102,102,102,1);
    
    
    
    UIView *bottomView=[UIView new];
    [centerView addSubview:bottomView];
    [bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.mas_equalTo(0);
        make.top.mas_equalTo(xianView.mas_bottom);
    }];
    
    UILabel *collectLabel=[UILabel new];
    [bottomView addSubview:collectLabel];
    [collectLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30*_mainWidth);
        make.centerY.mas_equalTo(0);
        make.width.height.mas_equalTo(63*_mainWidth);
    }];
    collectLabel.textAlignment=NSTextAlignmentCenter;
    collectLabel.backgroundColor=rgba(255,102,0,1);
    collectLabel.layer.masksToBounds=YES;
    collectLabel.layer.cornerRadius=63*_mainWidth/2;
    collectLabel.text=@"收";
    collectLabel.font=[UIFont fontWithName:@"FZHei-B01" size:autoScaleW(25)];
    collectLabel.textColor=rgba(255,255,255,1);
    
    UILabel *collectAddressLabel=[UILabel new];
    [bottomView addSubview:collectAddressLabel];
    [collectAddressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(xianView);
        make.right.mas_equalTo(-40*_mainWidth);
        make.bottom.mas_equalTo(collectLabel.mas_centerY).mas_equalTo(-_mainHeight*5);
    }];
    collectAddressLabel.numberOfLines=0;
    collectAddressLabel.font=[UIFont fontWithName:@"PingFang SC" size:autoScaleW(35)];
    collectAddressLabel.text=@"杭州市·新天地工程中城建六局";
    collectAddressLabel.textColor=rgba(47,47,47,1);
    
    UILabel *collectNameLabel=[UILabel new];
    [bottomView addSubview:collectNameLabel];
    [collectNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(xianView);
        make.right.mas_equalTo(-182*_mainWidth);
        make.top.mas_equalTo(collectLabel.mas_centerY).mas_equalTo(_mainHeight*5);
    }];
    collectNameLabel.numberOfLines=0;
    collectNameLabel.font=[UIFont fontWithName:@"PingFang SC" size:autoScaleW(35)];
    collectNameLabel.text=@"金有才\t13605443326";
    collectNameLabel.textColor=rgba(102,102,102,1);
    
    UIImageView *imageView=[UIImageView new];
    [centerView addSubview:imageView];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(0);
        make.centerX.mas_equalTo(collectLabel);
        make.height.mas_equalTo(_mainHeight*90);
        make.width.mas_equalTo(15*_mainWidth);
    }];
    imageView.image=[UIImage imageNamed:@"daoxiangjiantou"];
    
}

-(void)creatCompletedView{
    self.backgroundColor=[UIColor clearColor];
    
    UIView *centerView=[UIView new];
    [self.contentView addSubview:centerView];
    [centerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30*_mainWidth);
        make.right.mas_equalTo(-30*_mainWidth);
        make.top.mas_equalTo(10*_mainHeight);
        make.bottom.mas_equalTo(-10*_mainHeight);
    }];
    centerView.backgroundColor=[UIColor whiteColor];
    centerView.layer.cornerRadius=25*_mainWidth;
    centerView.layer.shadowColor = rgba(74,31,0,0.1).CGColor;
    centerView.layer.shadowOffset = CGSizeMake(0,0);
    centerView.layer.shadowOpacity = 1;
    centerView.layer.shadowRadius = 4;

    NSArray *arr=[NSArray arrayWithObjects:@"订单编号：",@"订单状态：",@"运输方式：",@"取件时间：",@"付款时间：",@"下单时间：",@"完成时间：",@"订单金额：", nil];
    
    NSArray *arr2=[NSArray arrayWithObjects:@"KY12321325135215",@"已完成",@"空运",@"2021-08-08 12:23",@"2021-08-08 12:23",@"2021-08-08 12:23",@"2021-08-08 12:00~13:00",@"¥1000", nil];
    
    CGFloat hegit=476/arr2.count;
    for (int i=0; i<arr.count;i++ ) {
        UIView *view=[UIView new];
        [centerView addSubview:view];
        [view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.mas_equalTo(0);
            make.height.mas_equalTo(hegit*_mainHeight);
            make.top.mas_equalTo(6*_mainHeight+hegit*i*_mainHeight);
        }];
        
        UILabel *label=[UILabel new];
        [view addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(46*_mainWidth);
            make.centerY.mas_equalTo(0);
            make.right.mas_equalTo(-90*_mainWidth);
        }];
        [label layoutIfNeeded];
        
        NSString *labelStr=[NSString stringWithFormat:@"%@\t%@",arr[i],arr2[i]];
        NSMutableAttributedString *titleAttri =  [[NSMutableAttributedString alloc] initWithString:labelStr];
        NSRange priceRange = [labelStr rangeOfString:[NSString stringWithFormat:@"%@",arr[i]]];//匹配得到的下标
        NSRange priceRange2 = [labelStr rangeOfString:[NSString stringWithFormat:@"%@",arr2[i]]];//匹配得到的下标
        [titleAttri addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:autoScaleW(26)] range:priceRange];
        [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(102,102,102,1) range:priceRange];
        [titleAttri addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:autoScaleW(26)] range:priceRange2];
        if (i==1) {
            [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(0,190,146,1) range:priceRange2];
        }else{
            [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(102,102,102,1) range:priceRange2];
        }
        label.attributedText=titleAttri;
        
        if (i==0) {
            UIButton *copyBtn=[UIButton new];
            [view addSubview:copyBtn];
            [copyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.mas_equalTo(0);
                make.right.mas_equalTo(-24*_mainWidth);
                make.width.height.mas_equalTo(30*_mainWidth);
            }];
            [copyBtn setImage:[UIImage imageNamed:@"fuzhi"] forState:0];
            [copyBtn addTarget:self action:@selector(copyClick) forControlEvents:UIControlEventTouchUpInside];
        }
    }
}
-(void)creatSignedView{
    self.backgroundColor=[UIColor clearColor];
    
    UIView *centerView=[UIView new];
    [self.contentView addSubview:centerView];
    [centerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30*_mainWidth);
        make.right.mas_equalTo(-30*_mainWidth);
        make.top.mas_equalTo(10*_mainHeight);
        make.bottom.mas_equalTo(-10*_mainHeight);
    }];
    centerView.backgroundColor=[UIColor whiteColor];
    centerView.layer.cornerRadius=25*_mainWidth;
    centerView.layer.shadowColor = rgba(74,31,0,0.1).CGColor;
    centerView.layer.shadowOffset = CGSizeMake(0,0);
    centerView.layer.shadowOpacity = 1;
    centerView.layer.shadowRadius = 4;

    NSArray *arr=[NSArray arrayWithObjects:@"订单编号：",@"订单状态：",@"运输方式：",@"下单时间：",@"付款时间：",@"取件时间：",@"预约送达时间：",@"订单金额：", nil];
    
    NSArray *arr2=[NSArray arrayWithObjects:@"KY12321325135215",@"待签收",@"空运",@"2021-08-08 12:23",@"2021-08-08 12:23",@"2021-08-08 12:23",@"2021-08-08 12:00~13:00",@"¥1000", nil];
    
    CGFloat hegit=476/arr2.count;
    for (int i=0; i<arr.count;i++ ) {
        UIView *view=[UIView new];
        [centerView addSubview:view];
        [view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.mas_equalTo(0);
            make.height.mas_equalTo(hegit*_mainHeight);
            make.top.mas_equalTo(6*_mainHeight+hegit*i*_mainHeight);
        }];
        
        UILabel *label=[UILabel new];
        [view addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(46*_mainWidth);
            make.centerY.mas_equalTo(0);
            make.right.mas_equalTo(-90*_mainWidth);
        }];
        [label layoutIfNeeded];
        
        NSString *labelStr=[NSString stringWithFormat:@"%@\t%@",arr[i],arr2[i]];
        NSMutableAttributedString *titleAttri =  [[NSMutableAttributedString alloc] initWithString:labelStr];
        NSRange priceRange = [labelStr rangeOfString:[NSString stringWithFormat:@"%@",arr[i]]];//匹配得到的下标
        NSRange priceRange2 = [labelStr rangeOfString:[NSString stringWithFormat:@"%@",arr2[i]]];//匹配得到的下标
        [titleAttri addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:autoScaleW(26)] range:priceRange];
        [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(102,102,102,1) range:priceRange];
        [titleAttri addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:autoScaleW(26)] range:priceRange2];
        if (i==1) {
            [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(241,81,26,1) range:priceRange2];
        }else{
            [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(102,102,102,1) range:priceRange2];
        }
        label.attributedText=titleAttri;
        
        if (i==0) {
            UIButton *copyBtn=[UIButton new];
            [view addSubview:copyBtn];
            [copyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.mas_equalTo(0);
                make.right.mas_equalTo(-24*_mainWidth);
                make.width.height.mas_equalTo(30*_mainWidth);
            }];
            [copyBtn setImage:[UIImage imageNamed:@"fuzhi"] forState:0];
            [copyBtn addTarget:self action:@selector(copyClick) forControlEvents:UIControlEventTouchUpInside];
        }
    }
}
-(void)creatPaymentView{
    self.backgroundColor=[UIColor clearColor];
    
    UIView *centerView=[UIView new];
    [self.contentView addSubview:centerView];
    [centerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30*_mainWidth);
        make.right.mas_equalTo(-30*_mainWidth);
        make.top.mas_equalTo(10*_mainHeight);
        make.bottom.mas_equalTo(-10*_mainHeight);
    }];
    centerView.backgroundColor=[UIColor whiteColor];
    centerView.layer.cornerRadius=25*_mainWidth;
    centerView.layer.shadowColor = rgba(74,31,0,0.1).CGColor;
    centerView.layer.shadowOffset = CGSizeMake(0,0);
    centerView.layer.shadowOpacity = 1;
    centerView.layer.shadowRadius = 4;

    NSArray *arr=[NSArray arrayWithObjects:@"订单编号：",@"订单状态：",@"运输方式：",@"下单时间：",@"预约上门时间：",@"订单金额：", nil];
    
    NSArray *arr2=[NSArray arrayWithObjects:@"KY12321325135215",@"待付款",@"空运",@"2021-08-08 12:23",@"2021-08-08 12:00~13:00",@"¥1000", nil];
    
    CGFloat hegit=362/arr2.count;
    for (int i=0; i<arr.count;i++ ) {
        UIView *view=[UIView new];
        [centerView addSubview:view];
        [view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.mas_equalTo(0);
            make.height.mas_equalTo(hegit*_mainHeight);
            make.top.mas_equalTo(6*_mainHeight+hegit*i*_mainHeight);
        }];
        
        UILabel *label=[UILabel new];
        [view addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(46*_mainWidth);
            make.centerY.mas_equalTo(0);
            make.right.mas_equalTo(-90*_mainWidth);
        }];
        [label layoutIfNeeded];
        
        NSString *labelStr=[NSString stringWithFormat:@"%@\t%@",arr[i],arr2[i]];
        NSMutableAttributedString *titleAttri =  [[NSMutableAttributedString alloc] initWithString:labelStr];
        NSRange priceRange = [labelStr rangeOfString:[NSString stringWithFormat:@"%@",arr[i]]];//匹配得到的下标
        NSRange priceRange2 = [labelStr rangeOfString:[NSString stringWithFormat:@"%@",arr2[i]]];//匹配得到的下标
        [titleAttri addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:autoScaleW(26)] range:priceRange];
        [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(102,102,102,1) range:priceRange];
        [titleAttri addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:autoScaleW(26)] range:priceRange2];
        if (i==1) {
            [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(241,81,26,1) range:priceRange2];
        }else{
            [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(102,102,102,1) range:priceRange2];
        }
        label.attributedText=titleAttri;
        
        if (i==0) {
            UIButton *copyBtn=[UIButton new];
            [view addSubview:copyBtn];
            [copyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.mas_equalTo(0);
                make.right.mas_equalTo(-24*_mainWidth);
                make.width.height.mas_equalTo(30*_mainWidth);
            }];
            [copyBtn setImage:[UIImage imageNamed:@"fuzhi"] forState:0];
            [copyBtn addTarget:self action:@selector(copyClick) forControlEvents:UIControlEventTouchUpInside];
        }
    }
}
-(void)creatOutstandingPartsView{
    self.backgroundColor=[UIColor clearColor];
    
    UIView *centerView=[UIView new];
    [self.contentView addSubview:centerView];
    [centerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30*_mainWidth);
        make.right.mas_equalTo(-30*_mainWidth);
        make.top.mas_equalTo(10*_mainHeight);
        make.bottom.mas_equalTo(-10*_mainHeight);
    }];
    centerView.backgroundColor=[UIColor whiteColor];
    centerView.layer.cornerRadius=25*_mainWidth;
    centerView.layer.shadowColor = rgba(74,31,0,0.1).CGColor;
    centerView.layer.shadowOffset = CGSizeMake(0,0);
    centerView.layer.shadowOpacity = 1;
    centerView.layer.shadowRadius = 4;

    NSArray *arr=[NSArray arrayWithObjects:@"订单编号：",@"订单状态：",@"运输方式：",@"下单时间：",@"付款时间：",@"预约上门时间：",@"订单金额：", nil];
    
    NSArray *arr2=[NSArray arrayWithObjects:@"KY12321325135215",@"待取件",@"空运",@"2021-08-08 12:23",@"2021-08-08 12:23",@"2021-08-08 12:00~13:00",@"¥1000", nil];
    
    CGFloat hegit=419/arr2.count;
    for (int i=0; i<arr.count;i++ ) {
        UIView *view=[UIView new];
        [centerView addSubview:view];
        [view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.mas_equalTo(0);
            make.height.mas_equalTo(hegit*_mainHeight);
            make.top.mas_equalTo(6*_mainHeight+hegit*i*_mainHeight);
        }];
        
        UILabel *label=[UILabel new];
        [view addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(46*_mainWidth);
            make.centerY.mas_equalTo(0);
            make.right.mas_equalTo(-90*_mainWidth);
        }];
        [label layoutIfNeeded];
        
        NSString *labelStr=[NSString stringWithFormat:@"%@\t%@",arr[i],arr2[i]];
        NSMutableAttributedString *titleAttri =  [[NSMutableAttributedString alloc] initWithString:labelStr];
        NSRange priceRange = [labelStr rangeOfString:[NSString stringWithFormat:@"%@",arr[i]]];//匹配得到的下标
        NSRange priceRange2 = [labelStr rangeOfString:[NSString stringWithFormat:@"%@",arr2[i]]];//匹配得到的下标
        [titleAttri addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:autoScaleW(26)] range:priceRange];
        [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(102,102,102,1) range:priceRange];
        [titleAttri addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:autoScaleW(26)] range:priceRange2];
        if (i==1) {
            [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(241,81,26,1) range:priceRange2];
        }else{
            [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(102,102,102,1) range:priceRange2];
        }
        label.attributedText=titleAttri;
        
        if (i==0) {
            UIButton *copyBtn=[UIButton new];
            [view addSubview:copyBtn];
            [copyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.mas_equalTo(0);
                make.right.mas_equalTo(-24*_mainWidth);
                make.width.height.mas_equalTo(30*_mainWidth);
            }];
            [copyBtn setImage:[UIImage imageNamed:@"fuzhi"] forState:0];
            [copyBtn addTarget:self action:@selector(copyClick) forControlEvents:UIControlEventTouchUpInside];
        }
    }
}
-(void)creatCancelView{
    self.backgroundColor=[UIColor clearColor];
    
    UIView *centerView=[UIView new];
    [self.contentView addSubview:centerView];
    [centerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30*_mainWidth);
        make.right.mas_equalTo(-30*_mainWidth);
        make.top.mas_equalTo(10*_mainHeight);
        make.bottom.mas_equalTo(-10*_mainHeight);
    }];
    centerView.backgroundColor=[UIColor whiteColor];
    centerView.layer.cornerRadius=25*_mainWidth;
    centerView.layer.shadowColor = rgba(74,31,0,0.1).CGColor;
    centerView.layer.shadowOffset = CGSizeMake(0,0);
    centerView.layer.shadowOpacity = 1;
    centerView.layer.shadowRadius = 4;

    NSArray *arr=[NSArray arrayWithObjects:@"订单编号：",@"订单状态：",@"运输方式：",@"下单时间：",@"取消时间：",@"订单金额：", nil];
    
    NSArray *arr2=[NSArray arrayWithObjects:@"KY12321325135215",@"已取消",@"空运",@"2021-08-08 12:23",@"2021-08-08 12:23",@"¥1000", nil];
    
    CGFloat hegit=362/arr2.count;
    for (int i=0; i<arr.count;i++ ) {
        UIView *view=[UIView new];
        [centerView addSubview:view];
        [view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.mas_equalTo(0);
            make.height.mas_equalTo(hegit*_mainHeight);
            make.top.mas_equalTo(6*_mainHeight+hegit*i*_mainHeight);
        }];
        
        UILabel *label=[UILabel new];
        [view addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(46*_mainWidth);
            make.centerY.mas_equalTo(0);
            make.right.mas_equalTo(-90*_mainWidth);
        }];
        [label layoutIfNeeded];
        
        NSString *labelStr=[NSString stringWithFormat:@"%@\t%@",arr[i],arr2[i]];
        NSMutableAttributedString *titleAttri =  [[NSMutableAttributedString alloc] initWithString:labelStr];
        NSRange priceRange = [labelStr rangeOfString:[NSString stringWithFormat:@"%@",arr[i]]];//匹配得到的下标
        NSRange priceRange2 = [labelStr rangeOfString:[NSString stringWithFormat:@"%@",arr2[i]]];//匹配得到的下标
        [titleAttri addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:autoScaleW(26)] range:priceRange];
        [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(102,102,102,1) range:priceRange];
        [titleAttri addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:autoScaleW(26)] range:priceRange2];
        if (i==1) {
            [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(51,51,51,1) range:priceRange2];
        }else{
            [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(102,102,102,1) range:priceRange2];
        }
        label.attributedText=titleAttri;
        
        if (i==0) {
            UIButton *copyBtn=[UIButton new];
            [view addSubview:copyBtn];
            [copyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.mas_equalTo(0);
                make.right.mas_equalTo(-24*_mainWidth);
                make.width.height.mas_equalTo(30*_mainWidth);
            }];
            [copyBtn setImage:[UIImage imageNamed:@"fuzhi"] forState:0];
            [copyBtn addTarget:self action:@selector(copyClick) forControlEvents:UIControlEventTouchUpInside];
        }
    }
}
-(void)creatInRefundView{
    self.backgroundColor=[UIColor clearColor];
    
    UIView *centerView=[UIView new];
    [self.contentView addSubview:centerView];
    [centerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30*_mainWidth);
        make.right.mas_equalTo(-30*_mainWidth);
        make.top.mas_equalTo(10*_mainHeight);
        make.bottom.mas_equalTo(-10*_mainHeight);
    }];
    centerView.backgroundColor=[UIColor whiteColor];
    centerView.layer.cornerRadius=25*_mainWidth;
    centerView.layer.shadowColor = rgba(74,31,0,0.1).CGColor;
    centerView.layer.shadowOffset = CGSizeMake(0,0);
    centerView.layer.shadowOpacity = 1;
    centerView.layer.shadowRadius = 4;

    NSArray *arr=[NSArray arrayWithObjects:@"订单编号：",@"订单状态：",@"运输方式：",@"下单时间：",@"申请退款时间：",@"订单金额：", nil];
    
    NSArray *arr2=[NSArray arrayWithObjects:@"KY12321325135215",@"退款中",@"空运",@"2021-08-08 12:23",@"2021-08-08 12:23",@"¥1000", nil];
    
    CGFloat hegit=362/arr2.count;
    for (int i=0; i<arr.count;i++ ) {
        UIView *view=[UIView new];
        [centerView addSubview:view];
        [view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.mas_equalTo(0);
            make.height.mas_equalTo(hegit*_mainHeight);
            make.top.mas_equalTo(6*_mainHeight+hegit*i*_mainHeight);
        }];
        
        UILabel *label=[UILabel new];
        [view addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(46*_mainWidth);
            make.centerY.mas_equalTo(0);
            make.right.mas_equalTo(-90*_mainWidth);
        }];
        [label layoutIfNeeded];
        
        NSString *labelStr=[NSString stringWithFormat:@"%@\t%@",arr[i],arr2[i]];
        NSMutableAttributedString *titleAttri =  [[NSMutableAttributedString alloc] initWithString:labelStr];
        NSRange priceRange = [labelStr rangeOfString:[NSString stringWithFormat:@"%@",arr[i]]];//匹配得到的下标
        NSRange priceRange2 = [labelStr rangeOfString:[NSString stringWithFormat:@"%@",arr2[i]]];//匹配得到的下标
        [titleAttri addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:autoScaleW(26)] range:priceRange];
        [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(102,102,102,1) range:priceRange];
        [titleAttri addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:autoScaleW(26)] range:priceRange2];
        if (i==1) {
            [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(250,100,0,1) range:priceRange2];
        }else{
            [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(102,102,102,1) range:priceRange2];
        }
        label.attributedText=titleAttri;
        
        if (i==0) {
            UIButton *copyBtn=[UIButton new];
            [view addSubview:copyBtn];
            [copyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.mas_equalTo(0);
                make.right.mas_equalTo(-24*_mainWidth);
                make.width.height.mas_equalTo(30*_mainWidth);
            }];
            [copyBtn setImage:[UIImage imageNamed:@"fuzhi"] forState:0];
            [copyBtn addTarget:self action:@selector(copyClick) forControlEvents:UIControlEventTouchUpInside];
        }
    }
}
-(void)creatRefundedView{
    self.backgroundColor=[UIColor clearColor];
    
    UIView *centerView=[UIView new];
    [self.contentView addSubview:centerView];
    [centerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30*_mainWidth);
        make.right.mas_equalTo(-30*_mainWidth);
        make.top.mas_equalTo(10*_mainHeight);
        make.bottom.mas_equalTo(-10*_mainHeight);
    }];
    centerView.backgroundColor=[UIColor whiteColor];
    centerView.layer.cornerRadius=25*_mainWidth;
    centerView.layer.shadowColor = rgba(74,31,0,0.1).CGColor;
    centerView.layer.shadowOffset = CGSizeMake(0,0);
    centerView.layer.shadowOpacity = 1;
    centerView.layer.shadowRadius = 4;

    NSArray *arr=[NSArray arrayWithObjects:@"订单编号：",@"订单状态：",@"运输方式：",@"下单时间：",@"申请退款时间：",@"退款到账时间：",@"订单金额：", nil];
    
    NSArray *arr2=[NSArray arrayWithObjects:@"KY12321325135215",@"已退款",@"空运",@"2021-08-08 12:23",@"2021-08-08 12:23",@"2021-08-08 12:23",@"¥1000", nil];
    
    CGFloat hegit=419/arr2.count;
    for (int i=0; i<arr.count;i++ ) {
        UIView *view=[UIView new];
        [centerView addSubview:view];
        [view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.mas_equalTo(0);
            make.height.mas_equalTo(hegit*_mainHeight);
            make.top.mas_equalTo(6*_mainHeight+hegit*i*_mainHeight);
        }];
        
        UILabel *label=[UILabel new];
        [view addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(46*_mainWidth);
            make.centerY.mas_equalTo(0);
            make.right.mas_equalTo(-90*_mainWidth);
        }];
        [label layoutIfNeeded];
        
        NSString *labelStr=[NSString stringWithFormat:@"%@\t%@",arr[i],arr2[i]];
        NSMutableAttributedString *titleAttri =  [[NSMutableAttributedString alloc] initWithString:labelStr];
        NSRange priceRange = [labelStr rangeOfString:[NSString stringWithFormat:@"%@",arr[i]]];//匹配得到的下标
        NSRange priceRange2 = [labelStr rangeOfString:[NSString stringWithFormat:@"%@",arr2[i]]];//匹配得到的下标
        [titleAttri addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:autoScaleW(26)] range:priceRange];
        [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(102,102,102,1) range:priceRange];
        [titleAttri addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:autoScaleW(26)] range:priceRange2];
        if (i==1) {
            [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(38,129,215,1) range:priceRange2];
        }else{
            [titleAttri addAttribute:NSForegroundColorAttributeName value:rgba(102,102,102,1) range:priceRange2];
        }
        label.attributedText=titleAttri;
        
        if (i==0) {
            UIButton *copyBtn=[UIButton new];
            [view addSubview:copyBtn];
            [copyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.mas_equalTo(0);
                make.right.mas_equalTo(-24*_mainWidth);
                make.width.height.mas_equalTo(30*_mainWidth);
            }];
            [copyBtn setImage:[UIImage imageNamed:@"fuzhi"] forState:0];
            [copyBtn addTarget:self action:@selector(copyClick) forControlEvents:UIControlEventTouchUpInside];
        }
    }
}
-(void)creatPetView{
    self.backgroundColor=[UIColor clearColor];
    
    UIView *centerView=[UIView new];
    [self.contentView addSubview:centerView];
    [centerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30*_mainWidth);
        make.right.mas_equalTo(-30*_mainWidth);
        make.top.mas_equalTo(10*_mainHeight);
        make.bottom.mas_equalTo(-10*_mainHeight);
    }];
    centerView.backgroundColor=[UIColor whiteColor];
    centerView.layer.cornerRadius=25*_mainWidth;
    centerView.layer.shadowColor = rgba(74,31,0,0.1).CGColor;
    centerView.layer.shadowOffset = CGSizeMake(0,0);
    centerView.layer.shadowOpacity = 1;
    centerView.layer.shadowRadius = 4;
    
    
    for (int i=0; i<2; i++) {
        UIView *backeView=[UIView new];
        [centerView addSubview:backeView];
        [backeView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(22*_mainWidth);
            make.top.mas_equalTo(22*_mainHeight+286*_mainHeight*i+20*_mainHeight*(i));
            make.right.mas_equalTo(-22*_mainWidth);
            make.height.mas_equalTo(286*_mainWidth);
        }];
        backeView.layer.masksToBounds=YES;
        backeView.layer.borderWidth=2*_mainWidth;
        backeView.layer.borderColor=rgba(250,100,0,0.19).CGColor;
        backeView.layer.cornerRadius=25*_mainHeight;
        
        
        UIView *xianView=[UIView new];
        [backeView addSubview:xianView];
        [xianView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(30*_mainWidth);
            make.right.mas_offset(-30*_mainWidth);
            make.height.mas_equalTo(2*_mainHeight);
            make.bottom.mas_equalTo(-87*_mainWidth);
        }];
        xianView.backgroundColor=rgba(232,232,232,1);
        
        UIView *topView=[UIView new];
        [backeView addSubview:topView];
        [topView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.mas_equalTo(0);
            make.bottom.mas_equalTo(xianView.mas_top);
        }];
        
        UIImageView *petImage=[UIImageView new];
        [topView addSubview:petImage];
        [petImage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(21*_mainWidth);
            make.centerY.mas_equalTo(0);
            make.width.height.mas_equalTo(141*_mainWidth);
        }];
        petImage.layer.masksToBounds=YES;
        petImage.layer.cornerRadius=141*_mainWidth/2;
        [petImage sd_setImageWithURL:nil placeholderImage:[UIImage imageNamed:@"gou"]];
        
        UILabel *nameLabel=[UILabel new];
        [topView addSubview:nameLabel];
        [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(petImage.mas_right).mas_equalTo(15*_mainWidth);
            make.top.mas_equalTo(52*_mainHeight);
            make.right.mas_equalTo(-90*_mainWidth);
        }];
        nameLabel.text=@"狗【富贵】";
        nameLabel.textColor=rgba(47,47,47,1);
        nameLabel.font=[UIFont fontWithName:@"PingFang SC" size:autoScaleW(36)];
        
        UILabel *label2=[UILabel new];
        [topView addSubview:label2];
        [label2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(nameLabel);
            make.bottom.mas_equalTo(-35*_mainHeight);
        }];
        [label2 layoutIfNeeded];
        label2.text=@"大型";
        label2.font=[UIFont fontWithName:@"PingFang SC" size:autoScaleW(25)];
        label2.textColor=rgba(102,102,102,1);
        
        UIView *dogXian2=[UIView new];
        [topView addSubview:dogXian2];
        [dogXian2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(label2.mas_right).mas_equalTo(10*_mainWidth);
            make.centerY.mas_equalTo(label2);
            make.width.mas_equalTo(2*_mainWidth);
            make.height.mas_equalTo(23*_mainHeight);
        }];
        dogXian2.backgroundColor=rgba(151,151,151,1);
        
        UILabel *label3=[UILabel new];
        [topView addSubview:label3];
        [label3 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(dogXian2.mas_right).mas_equalTo(10*_mainWidth);
            make.centerY.mas_equalTo(label2);
        }];
        [label3 layoutIfNeeded];
        label3.text=@"3～4kg";
        label3.font=label2.font;
        label3.textColor=label2.textColor;
        
        UIView *dogXian3=[UIView new];
        [topView addSubview:dogXian3];
        [dogXian3 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(label3.mas_right).mas_equalTo(10*_mainWidth);
            make.centerY.mas_equalTo(label2);
            make.width.mas_equalTo(2*_mainWidth);
            make.height.mas_equalTo(23*_mainHeight);
        }];
        dogXian3.backgroundColor=rgba(151,151,151,1);

        UILabel *label4=[UILabel new];
        [topView addSubview:label4];
        [label4 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(dogXian3.mas_right).mas_equalTo(10*_mainWidth);
            make.centerY.mas_equalTo(label2);
        }];
        [label4 layoutIfNeeded];
        label4.text=@"无过往病例";
        label4.font=label2.font;
        label4.textColor=label2.textColor;
        
    
        UIView *bottomView=[UIView new];
        [backeView addSubview:bottomView];
        [bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.bottom.mas_equalTo(0);
            make.top.mas_equalTo(xianView.mas_bottom);
        }];
        
        
        UILabel *rightLabel=[UILabel new];
        [bottomView addSubview:rightLabel];
        [rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-31*_mainHeight);
            make.centerY.mas_equalTo(0);
        }];
        NSString *typeStr=@"查看物流 ";
        NSMutableAttributedString *attri =  [[NSMutableAttributedString alloc] initWithString:typeStr];
        // 2.添加表情图片
        NSTextAttachment *attch = [[NSTextAttachment alloc] init];
        // 表情图片
        attch.image = [UIImage imageNamed:@"gengduo-1"];
            // 设置图片大小
        attch.bounds = CGRectMake(0, 0, 8*_mainWidth, 16*_mainHeight);
        // 创建带有图片的富文本
        NSAttributedString *string = [NSAttributedString attributedStringWithAttachment:attch];
        [attri insertAttributedString:string atIndex:typeStr.length];//插入某个位置
       
        rightLabel.attributedText=attri;
        rightLabel.textColor=rgba(250,100,0,1);
        rightLabel.font=[UIFont fontWithName:@"PingFang SC" size:autoScaleW(25)];
        rightLabel.textAlignment=NSTextAlignmentRight;

       
        UILabel *label=[UILabel new];
        [bottomView addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(46*_mainWidth);
            make.centerY.mas_equalTo(0);
        }];
        [label layoutIfNeeded];
        label.text=@"运单号：KY12321325135215";
        label.textColor=rgba(102,102,102,1);
        label.font=[UIFont fontWithName:@"PingFang SC" size:autoScaleW(26)];
 
        UIButton *copyBtn=[UIButton new];
        [bottomView addSubview:copyBtn];
        [copyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(label);
            make.left.mas_equalTo(label.mas_right).mas_equalTo(24*_mainWidth);
            make.width.height.mas_equalTo(30*_mainWidth);
        }];
        [copyBtn setImage:[UIImage imageNamed:@"fuzhi"] forState:0];
        [copyBtn addTarget:self action:@selector(copyClick) forControlEvents:UIControlEventTouchUpInside];
    }
}
-(void)creatPetView2{
    self.backgroundColor=[UIColor clearColor];
    
    UIView *centerView=[UIView new];
    [self.contentView addSubview:centerView];
    [centerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30*_mainWidth);
        make.right.mas_equalTo(-30*_mainWidth);
        make.top.mas_equalTo(10*_mainHeight);
        make.bottom.mas_equalTo(-10*_mainHeight);
    }];
    centerView.backgroundColor=[UIColor whiteColor];
    centerView.layer.cornerRadius=25*_mainWidth;
    centerView.layer.shadowColor = rgba(74,31,0,0.1).CGColor;
    centerView.layer.shadowOffset = CGSizeMake(0,0);
    centerView.layer.shadowOpacity = 1;
    centerView.layer.shadowRadius = 4;
    
    
    for (int i=0; i<2; i++) {
        UIView *backeView=[UIView new];
        [centerView addSubview:backeView];
        [backeView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(22*_mainWidth);
            make.top.mas_equalTo(22*_mainHeight+207*_mainHeight*i+20*_mainHeight*(i));
            make.right.mas_equalTo(-22*_mainWidth);
            make.height.mas_equalTo(207*_mainWidth);
        }];
        backeView.layer.masksToBounds=YES;
        backeView.layer.borderWidth=2*_mainWidth;
        backeView.layer.borderColor=rgba(250,100,0,0.19).CGColor;
        backeView.layer.cornerRadius=25*_mainHeight;
        
        
        UIView *topView=[UIView new];
        [backeView addSubview:topView];
        [topView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.mas_equalTo(0);
            make.bottom.mas_equalTo(0);
        }];
        
        UIImageView *petImage=[UIImageView new];
        [topView addSubview:petImage];
        [petImage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(21*_mainWidth);
            make.centerY.mas_equalTo(0);
            make.width.height.mas_equalTo(141*_mainWidth);
        }];
        petImage.layer.masksToBounds=YES;
        petImage.layer.cornerRadius=141*_mainWidth/2;
        [petImage sd_setImageWithURL:nil placeholderImage:[UIImage imageNamed:@"gou"]];
        
        UILabel *nameLabel=[UILabel new];
        [topView addSubview:nameLabel];
        [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(petImage.mas_right).mas_equalTo(15*_mainWidth);
            make.top.mas_equalTo(52*_mainHeight);
            make.right.mas_equalTo(-90*_mainWidth);
        }];
        nameLabel.text=@"狗【富贵】";
        nameLabel.textColor=rgba(47,47,47,1);
        nameLabel.font=[UIFont fontWithName:@"PingFang SC" size:autoScaleW(36)];
        
        UILabel *label2=[UILabel new];
        [topView addSubview:label2];
        [label2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(nameLabel);
            make.bottom.mas_equalTo(-35*_mainHeight);
        }];
        [label2 layoutIfNeeded];
        label2.text=@"大型";
        label2.font=[UIFont fontWithName:@"PingFang SC" size:autoScaleW(25)];
        label2.textColor=rgba(102,102,102,1);
        
        UIView *dogXian2=[UIView new];
        [topView addSubview:dogXian2];
        [dogXian2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(label2.mas_right).mas_equalTo(10*_mainWidth);
            make.centerY.mas_equalTo(label2);
            make.width.mas_equalTo(2*_mainWidth);
            make.height.mas_equalTo(23*_mainHeight);
        }];
        dogXian2.backgroundColor=rgba(151,151,151,1);
        
        UILabel *label3=[UILabel new];
        [topView addSubview:label3];
        [label3 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(dogXian2.mas_right).mas_equalTo(10*_mainWidth);
            make.centerY.mas_equalTo(label2);
        }];
        [label3 layoutIfNeeded];
        label3.text=@"3～4kg";
        label3.font=label2.font;
        label3.textColor=label2.textColor;
        
        UIView *dogXian3=[UIView new];
        [topView addSubview:dogXian3];
        [dogXian3 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(label3.mas_right).mas_equalTo(10*_mainWidth);
            make.centerY.mas_equalTo(label2);
            make.width.mas_equalTo(2*_mainWidth);
            make.height.mas_equalTo(23*_mainHeight);
        }];
        dogXian3.backgroundColor=rgba(151,151,151,1);

        UILabel *label4=[UILabel new];
        [topView addSubview:label4];
        [label4 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(dogXian3.mas_right).mas_equalTo(10*_mainWidth);
            make.centerY.mas_equalTo(label2);
        }];
        [label4 layoutIfNeeded];
        label4.text=@"无过往病例";
        label4.font=label2.font;
        label4.textColor=label2.textColor;
    }
}
-(void)creatPaymentBtnView{
    self.backgroundColor=[UIColor clearColor];
    self.timeTick=1800;
    UIView *titleView=[UIView new];
    [self.contentView addSubview:titleView];
    [titleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.mas_equalTo(0);
        make.height.mas_equalTo(87*_mainHeight);
    }];
    
    self.titleLabel=[UILabel new];
    [titleView addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(0);
    }];
    NSString *titleStr=[NSString stringWithFormat:@"剩余付款时间：%ld:%ld",self.timeTick/60,self.timeTick%60];
    self.titleLabel.text=titleStr;
    self.titleLabel.font=[UIFont fontWithName:@"PingFang SC" size:autoScaleW(28)];
    self.titleLabel.textColor=rgba(255,106,0,1);
    
    UIButton *submitBtn=[UIButton new];
    [self.contentView addSubview:submitBtn];
    [submitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(39*_mainWidth);
        make.width.mas_equalTo(_mainW-78*_mainWidth);
        make.top.mas_equalTo(titleView.mas_bottom).mas_equalTo(0);
        make.height.mas_equalTo(_mainHeight*87);
    }];
    [submitBtn setTitle:@"立即支付" forState:0];
    [submitBtn setTitleColor:[UIColor whiteColor] forState:0];
    submitBtn.titleLabel.font=[UIFont fontWithName:@"PingFang SC" size:autoScaleW(36)];
    [submitBtn layoutIfNeeded];
    submitBtn.layer.masksToBounds=YES;
    submitBtn.layer.cornerRadius=87*_mainHeight/2;
    CAGradientLayer *gradientLayer = [CAGradientLayer layer];
    gradientLayer.frame = submitBtn.bounds;
    //将CAGradientlayer对象添加在我们要设置背景色的视图的layer层
    [submitBtn.layer insertSublayer:gradientLayer atIndex:0];
    //设置渐变区域的起始和终止位置（范围为0-1）
    gradientLayer.startPoint = CGPointMake(0, 1);
    gradientLayer.endPoint = CGPointMake(1, 1);
    gradientLayer.colors = @[(__bridge id)rgba(255,159,0,1).CGColor,
                             (__bridge id)rgba(255,116,0,1).CGColor ,
                             (__bridge id)rgba(255,102,0,1).CGColor];
    //设置颜色分割点（范围：0-1）
    gradientLayer.locations = @[@(0),@(0.5), @(1.0f)];
    submitBtn.layer.shadowColor = rgba(196,50,0,0.36).CGColor;
    submitBtn.layer.shadowOffset = CGSizeMake(0,0);
    submitBtn.layer.shadowOpacity = 1;
    submitBtn.layer.shadowRadius = 4;
    
    
    UIButton *updateOrderBtn=[UIButton new];
    [self.contentView addSubview:updateOrderBtn];
    [updateOrderBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(39*_mainWidth);
        make.width.mas_equalTo(_mainW-78*_mainWidth);
        make.top.mas_equalTo(submitBtn.mas_bottom).mas_equalTo(30*_mainHeight);
        make.height.mas_equalTo(_mainHeight*87);
    }];
    [updateOrderBtn setTitle:@"修改订单" forState:0];
    [updateOrderBtn setTitleColor:rgba(255,102,0,1) forState:0];
    updateOrderBtn.titleLabel.font=[UIFont fontWithName:@"PingFang SC" size:autoScaleW(36)];
    updateOrderBtn.layer.borderWidth=2*_mainHeight;
    updateOrderBtn.layer.borderColor=rgba(255,102,0,1).CGColor;
    updateOrderBtn.layer.masksToBounds=YES;
    updateOrderBtn.layer.cornerRadius=87*_mainHeight/2;
    
    updateOrderBtn.layer.shadowColor = rgba(196,50,0,0.36).CGColor;
    updateOrderBtn.layer.shadowOffset = CGSizeMake(0,0);
    updateOrderBtn.layer.shadowOpacity = 0.5;
    updateOrderBtn.layer.shadowRadius = 0.5;
    
    
    UIButton *cancellationOrderBtn=[UIButton new];
    [self.contentView addSubview:cancellationOrderBtn];
    [cancellationOrderBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(39*_mainWidth);
        make.width.mas_equalTo(_mainW-78*_mainWidth);
        make.top.mas_equalTo(updateOrderBtn.mas_bottom).mas_equalTo(30*_mainHeight);
        make.height.mas_equalTo(_mainHeight*87);
    }];
    [cancellationOrderBtn setTitle:@"取消订单" forState:0];
    [cancellationOrderBtn setTitleColor:rgba(255,102,0,1) forState:0];
    updateOrderBtn.titleLabel.font=[UIFont fontWithName:@"PingFang SC" size:autoScaleW(36)];
    cancellationOrderBtn.layer.borderWidth=2*_mainHeight;
    cancellationOrderBtn.layer.borderColor=rgba(255,102,0,1).CGColor;
    cancellationOrderBtn.layer.masksToBounds=YES;
    cancellationOrderBtn.layer.cornerRadius=87*_mainHeight/2;
    cancellationOrderBtn.layer.shadowColor = rgba(196,50,0,0.36).CGColor;
    cancellationOrderBtn.layer.shadowOffset = CGSizeMake(0,0);
    cancellationOrderBtn.layer.shadowOpacity = 0.5;
    cancellationOrderBtn.layer.shadowRadius = 0.5;
    
    self.timer=[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(timeFireMethod) userInfo:nil repeats:YES];
    
}

-(void)timeFireMethod
{
    if (_timeTick==0) {
        
        [_timer invalidate];
        return;
    }
    _timeTick--;
    
    NSString *typeStr=[NSString stringWithFormat:@"剩余付款时间：  %ld:%ld",self.timeTick/60,self.timeTick%60];
    self.titleLabel.text=typeStr;
    
}

- (void)copyClick {
    UIPasteboard *pab = [UIPasteboard generalPasteboard];
    pab.string = @"12345";
    [ZQTools svpInfo:@"复制成功"];

}
@end
